<%--
  Created by IntelliJ IDEA.
  User: 谢兴鑫
  Date: 2022/5/13
  Time: 上午 09:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
</head>
<script>
    layui.use(['table', 'util', 'jquery', 'layer', 'laypage'], function () {
        var table = layui.table, util = layui.util, $ = layui.jquery, layer = layui.layer, form = layui.form,
            laypage = layui.laypage;
        //监听表单提交
        form.on('submit(formbtn)', function () {
            $("#formsbt").ajaxSubmit({
                type: "post",
                url: '${pageContext.request.contextPath }/holidaystudent/stucomplete',
                success: function (data) {//添加成功的回调函数
                    layer.msg('提交成功', {icon: 1, skin: 'success-class'});
                    var index = parent.layer.getFrameIndex(window.name);//获取Frame索引
                    parent.layer.close(index);//关闭当前frame
                    parent.layui.table.reload("tableData");//可以对父窗口进行刷新
                }
            });
        });
    });

</script>

<body>
<h2 align="center">审核请假申请</h2>
<hr/>
<form class="layui-form" id="formsbt">
    <input type="hidden" name="holidayId" value="${holidaystudent.holidayId}"/>
    <input type="hidden" name="taskId" value="${taskId}"/>
    <table class="layui-table" lay-skin='nob'>
        <tr>
            <td align="right">请假人</td>
            <td>${holidaystudent.stuId}</td>
        </tr>
        <tr bgcolor="white">
            <td align="right">请假天数：</td>
            <td>${holidaystudent.holidayDay}</td>
        </tr>
        <tr bgcolor="white">
            <td align="right">填单时间：</td>
            <td>${holidaystudent.startTime}</td>
        </tr>
        <tr bgcolor="white">
            <td align="right">截至时间：</td>
            <td>${holidaystudent.endTime}</td>
        </tr>
        <tr bgcolor="white">
            <td align="right">请假事由：</td>
            <td>${holidaystudent.title}</td>
        </tr>
        <tr bgcolor="white">
            <td align="right">备注：</td>
            <td>${holidaystudent.remark}</td>
        </tr>

        <tr bgcolor="white">
            <td align="right">是否批准：</td>
            <td>
                <select name="flow">
                    <c:forEach items="${stupvmList}" var="p">
                        <option value="${p.name}">${p.name}</option>
                        <option value="${p.name2}">${p.name2}</option>
                    </c:forEach>
                </select>
        </tr>
        <tr bgcolor="white">
            <td align="right">审批意见：</td>
            <td><textarea name="comment"></textarea></td>
        </tr>
    </table>
    <%--    <button type="button" class="layui-btn">--%>
    <%--        <td colspan="2" align="center">--%>
    <%--            <input type="submit" value="审批">--%>
    <%--        </td>--%>
    <%--    </button>--%>
    <button id="formbtn" type="button" lay-submit lay-filter="formbtn" class="layui-btn layui-btn-normal">
        提交
    </button>
</form>
<blockquote class="layui-elem-quote">历史审批信息</blockquote>
<table class="layui-table">
    <thead>
    <tr>
        <th>ID</th>
        <th>审批时间</th>
        <th>审批人</th>
        <th>批注内容</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${stucommentList}" var="t">
        <tr>
            <td>${t.id }</td>
            <td>${t.time}</td>
            <td>${t.userId }</td>
            <td>${t.fullMessage }</td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
